%%
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi0;
pcolor(yy,xx,squeeze(pl));caxis([0,1]);t=0*dt;tx=['t=',num2str(t)];suptitle(tx);
%colorbar('Ticks',(-mx:mx:mx),'Fontsize',15);
shading interp;colormap hot;
set(gca,'YTick',0:7:14);ylabel('x','FontSize',15)
set(gca,'XTick',0:20:60);xlabel('y','FontSize',15)
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);
drawnow
%%
fid_start=['dat0050'];fid_start=['./data/',fid_start,'.mat'];load(fid_start)
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi+wi0;
pcolor(yy,xx,squeeze(pl));caxis([0,1]);t=50*dt;tx=['t=',num2str(t)];suptitle(tx);
%colorbar('Ticks',(-mx:mx:mx),'Fontsize',15);
shading interp;colormap hot;
set(gca,'YTick',0:7:14);ylabel('x','FontSize',15)
set(gca,'XTick',0:20:60);xlabel('y','FontSize',15)
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);
drawnow
%%
fid_start=['dat0080'];fid_start=['./data/',fid_start,'.mat'];load(fid_start)
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi+wi0;
pcolor(yy,xx,squeeze(pl));caxis([0,1]);t=80*dt;tx=['t=',num2str(t)];suptitle(tx);
%colorbar('Ticks',(-mx:mx:mx),'Fontsize',15);
shading interp;colormap hot;
set(gca,'YTick',0:7:14);ylabel('x','FontSize',15)
set(gca,'XTick',0:20:60);xlabel('y','FontSize',15)
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);
drawnow
%%
fid_start=['dat0150'];fid_start=['./data/',fid_start,'.mat'];load(fid_start)
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi+wi0;
pcolor(yy,xx,squeeze(pl));caxis([0,1]);t=150*dt;tx=['t=',num2str(t)];suptitle(tx);
%colorbar('Ticks',(-mx:mx:mx),'Fontsize',15);
shading interp;colormap hot;
set(gca,'YTick',0:7:14);ylabel('x','FontSize',15)
set(gca,'XTick',0:20:60);xlabel('y','FontSize',15)
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);
drawnow
%%
fid_start=['dat0300'];fid_start=['./data/',fid_start,'.mat'];load(fid_start)
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi+wi0;
pcolor(yy,xx,squeeze(pl));caxis([0,1]);t=300*dt;tx=['t=',num2str(t)];suptitle(tx);
%colorbar('Ticks',(-mx:mx:mx),'Fontsize',15);
shading interp;colormap hot;
set(gca,'YTick',0:7:14);ylabel('x','FontSize',15)
set(gca,'XTick',0:20:60);xlabel('y','FontSize',15)
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);
drawnow
%%
xx=linspace(0,alx,nx);
yy=0:dy:aly+dy; 
tt=0:dt:nts*dt;
w1=zeros(nts+1,nx,20);w2=zeros(nts+1,nx,20);
load([saldir,'initial'])
sv=fft(wi,[],2);w1(1,:,:)=sv(:,2:21);
sv=fft(phii,[],2);w2(1,:,:)=sv(:,2:21);
for nt=1:nts
    load([saldir,'dat',sprintf('%4.4d',nt)])
    sv=fft(wi,[],2);w1(nt+1,:,:)=sv(:,2:21);
    sv=fft(phii,[],2);w2(nt+1,:,:)=sv(:,2:21);
    for m=1:20
        w1(nt+1,:,m)=smooth(w1(nt+1,:,m));
    end
end
%%
set(gcf,'Units','centimeters','Position',[1 1 14 10]);
pcolor(xx,tt(1:151),squeeze(angle(w1(1:151,:,4))/pi));
shading interp;colormap hot;title('$k_y=k_{y,4}$','interpreter','latex');
set(gca,'YTick',0:50:150);ylabel('t','FontSize',15);
set(gca,'XTick',0:7:14);xlabel('x','FontSize',15);
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');h=colorbar;
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.95-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);caxis([-1,1]);
%set(get(h,'title'),'string','$\times \pi$','interpreter','latex','fontsize',15);
drawnow
%%
set(gcf,'Units','centimeters','Position',[1 1 14 10]);
pcolor(xx,tt(51:151),squeeze(angle(w1(51:151,:,2))/pi));
shading interp;colormap hot;title('$k_y=k_{y,2}$','interpreter','latex');
set(gca,'YTick',50:50:150);ylabel('t','FontSize',15);
set(gca,'XTick',0:7:14);xlabel('x','FontSize',15);
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');h=colorbar;
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.95-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Fontsize',15);caxis([-0.5,1]);
%set(get(h,'title'),'string','$\times \pi$','interpreter','latex','fontsize',15);
drawnow
%%
set(gcf,'Units','centimeters','Position',[1 1 14 10]);
pcolor(xx,tt(151:301),squeeze(angle(w1(151:301,:,1))/pi));
shading interp;colormap hot;title('$k_y=k_{y,1}$','interpreter','latex');
set(gca,'YTick',150:50:300);ylabel('t','FontSize',15);
set(gca,'XTick',0:7:14);xlabel('x','FontSize',15);
set(gca,'FontSize',15);set(gca,'tickdir','out');
margin = get(gca, 'TightInset');h=colorbar;
set(gca, 'Position', [0+margin(1) 0+margin(2) 0.85-margin(1)-margin(3) (0.95-margin(2)-margin(4))])
colorbar('position',[0.86 margin(2) 0.04 0.6],'Ticks',(-1:0.6:1),'Fontsize',15);
caxis([-1,0.3]);
drawnow
%%
fid_start=['dat0050'];fid_start=['./data/',fid_start,'.mat'];load(fid_start)
set(gcf,'Units','centimeters','Position',[1 1 14 7]);pl=wi+wi0;
ft=fft(pl,ny0,2);a1=ft(:,1)/ny0;a2=(a1(3:end)-a1(1:end-2))/xx(3);
plot(xx(2:end-1),a2,'linewidth',2);
ylabel('$q_0^{\prime}$','interpreter','latex','fontsize',15);
xlabel('x','fontsize',15);xlim([3,11]);ylim([-0.39,0.35]);
set(gca,'YTick',-0.6:0.2:0.6);set(gca,'XTick',0:2:14);
margin = get(gca, 'TightInset');set(gca,'fontsize',15);
set(gca, 'Position', [0+margin(1)*1.25 0+margin(2)*1.25 0.95-margin(1)-margin(3) (0.9-margin(2)-margin(4))])
drawnow